import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Register from '../views/Register.vue'
import RegisterInfo from '../views/RegisterInfo.vue'
import ActiveAccount from '../views/ActiveAccount.vue'
import Success from '../views/Success.vue'
import Film from "../views/Film.vue"
import Video from "../views/Video.vue"
import MyCollection from '../views/MyCollection.vue'
import MyRate from '../views/MyRate.vue'
import MyComment from '../views/MyComment.vue'
import Index from '../views/Index.vue'
import UpdateInfo from "../views/UpdateInfo.vue";
import ToVip from "../views/ToVip.vue";
import MyOrder from "../views/MyOrder.vue"
import ItemRecommend from '../views/ItemRecommend.vue'
import Films from "../views/admin/Films.vue"
import Classifications from "../views/admin/Classifications.vue"
import Years from "../views/admin/Years.vue"
import Comments from "../views/admin/Comments.vue"
import Scores from "../views/admin/Scores.vue"
import Orders from "../views/admin/Orders.vue"
import AdminLogin from "../views/admin/AdminLogin.vue"
import EditFilm from "../views/admin/EditFilm.vue";



Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Index',
    redirect: { name: 'Index' }
  },
  {
    path: '/index',
    name: 'movies',
    component: Index
  },
  {
    path: '/login',
    name: 'Login',
    component: Login
  },
  {
    path: '/itemRecommend',
    name: 'ItemRecommend',
    component: ItemRecommend
  },
  {
    path: '/register',
    name: 'Register',
    component: Register
  },
  {
    path: '/registerInfo/:userId',
    name: 'RegisterInfo',
    component: RegisterInfo
  },
  {
    path: '/activeAccount/:email/:userId',
    name: 'ActiveAccount',
    component: ActiveAccount
  },
  {
    path: '/success',
    name: 'Success',
    component: Success
  },
  {
    path: '/film/:id',
    name: 'Film',
    component: Film
  },
  {
    path: '/myCollection',
    name: 'MyCollection',
    component: MyCollection
  },
  {
    path: '/myComment',
    name: 'MyComment',
    component: MyComment

  },
  {
    path: '/myRate',
    name: 'MyRate',
    component: MyRate
  },
  {
    path: '/updateInfo',
    name: 'UpdateInfo',
    component: UpdateInfo
  },
  {
    path: '/toVip',
    name: 'ToVip',
    component: ToVip
  },
  {
    path: '/myOrder',
    name: 'MyOrder',
    component: MyOrder
  },
  {
    path: '/films',
    name: 'Films',
    component: Films
  },
  {
    path: '/class',
    name: 'Classifications',
    component: Classifications
  },
  {
    path: '/years',
    name: 'Years',
    component: Years
  },
  {
    path: '/comments',
    name: 'Comments',
    component: Comments
  },
  {
    path: '/scores',
    name: 'Scores',
    component: Scores
  },
  {
    path: '/orders',
    name: 'Orders',
    component: Orders
  },
  {
    path: '/adminLogin',
    name: 'AdminLogin',
    component: AdminLogin
  },
  {
    path: '/addFilm',
    name: 'addFilm',
    component: EditFilm
  },
  {
    path: '/editFilm/:id',
    name: 'editFilm',
    component: EditFilm
  },
  {
    path: '/video/:id',
    name: 'Video',
    component: Video
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
